﻿@model MyCompanyName.AbpZeroTemplate.Web.Models.Consent.ConsentViewModel
@{
    Layout = "~/Views/Account/_Layout.cshtml";
    ViewBag.DisableTenantChange = true;
}

@if (Model.ClientLogoUrl != null)
{
    <div class="client-logo"><img src="@Model.ClientLogoUrl"></div>
}
<h3>
    <small>@L("ClientIsRequestingYourPermission", Model.ClientName)</small>
</h3>

<form asp-action="Index">
    <input type="hidden" asp-for="ReturnUrl" />

    @if (Model.IdentityScopes.Any())
    {
        <div class="panel panel-default">
            <div class="panel-heading">
                <span class="glyphicon glyphicon-user"></span>
                @L("PersonalInformations")
            </div>
            <ul class="list-group">
                @foreach (var scope in Model.IdentityScopes)
                {
                    @Html.Partial("_ScopeListItem", scope)
                }
            </ul>
        </div>
    }

    @if (Model.ResourceScopes.Any())
    {
        <div class="panel panel-default">
            <div class="panel-heading">
                <span class="glyphicon glyphicon-tasks"></span>
                @L("ApplicationAccess")
            </div>
            <ul class="list-group">
                @foreach (var scope in Model.ResourceScopes)
                {
                    @Html.Partial("_ScopeListItem", scope)
                }
            </ul>
        </div>
    }

    @if (Model.AllowRememberConsent)
    {
        <div class="consent-remember">
            <label>
                <input class="consent-scopecheck" asp-for="RememberConsent" />
                <strong>@L("RememberMyDecision")</strong>
            </label>
        </div>
    }

    <div class="consent-buttons">
        <button name="button" value="yes" class="btn btn-primary" autofocus>@L("Allow")</button>
        <button name="button" value="no" class="btn">@L("DoNotAllow")</button>
    </div>
</form>